/**
 * 
 */
package util;

import model.*;

import java.util.ArrayList;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.googlecode.jsonplugin.annotations.JSON;
import com.opensymphony.xwork2.ActionSupport;

/** 
 * @作者 Zouzr 
 * @创建日期 Dec 16, 2008 
 * @版本 V 1.0 
 */

public class DepartmentSpecial extends ActionSupport
{
	private String specialdepartmentId;//学院id
	private List<Special> departmentspecials = new ArrayList<Special>();
	
	public String execute()
	{
		System.out.println("-----------------------------------------");
		System.out.println(specialdepartmentId);
		System.out.println("-----------------------------------------");
		
		ApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
        SpecialDAO specialdao = (SpecialDAO)context.getBean("SpecialDAOProxy");
        List temp_departmentspecials = specialdao.getAllSpecialByDepartmentId(specialdepartmentId);
        for(int i=0;i<temp_departmentspecials.size();i++)
        {
        	Special s = new Special();
        	s = (Special)temp_departmentspecials.get(i);
        	departmentspecials.add(s);
        }
		return SUCCESS;
	}
	
	
	/**
	 * @return the specialdepartmentId
	 */
	public String getSpecialdepartmentId() {
		return specialdepartmentId;
	}
	/**
	 * @param specialdepartmentId the specialdepartmentId to set
	 */
	public void setSpecialdepartmentId(String specialdepartmentId) {
		this.specialdepartmentId = specialdepartmentId;
	}
	/**
	 * @return the departmentspecials
	 */
	public List<Special> getDepartmentspecials() {
		return departmentspecials;
	}
	/**
	 * @param departmentspecials the departmentspecials to set
	 */
	public void setDepartmentspecials(List<Special> departmentspecials) {
		this.departmentspecials = departmentspecials;
	}
}
